<script language="javascript">
var dialogWidth=$(window).width()*0.2;
var dialogHeight=$(window).height()*0.06*3;
$(function(){
	$("#searchBtn").click(function(){
		artDialog(
		        {	
			        'title':'按条件查询',
			        width:dialogWidth,
			        height:  dialogHeight ,
			        okVal:"查询",
			        cancelVal:'关闭',
		            content:"<form id='searchForm' method='get' action='/user/index'>"+$('#searchdiv').html()+"</form>",
		            lock:true,
		        },
		        function(){
		                $('#searchForm').submit();
		        },
		        function(){
		            return true;
		        }
		);
		});
});
function getDetail(uid){
	location='/user/detail&sid=<?php echo $sid?>&uid='+uid
}
</script>
<!--  搜索表单  -->
<div  id="searchdiv" style="display:none;">
<input  type='hidden'  name='sid' value='<?php echo $sid?>'/>
 <table style="width:100%;height:100%" border=0>
	<tr>
	<td valign='middle' align="right"  style="padding:1  1 1 1;width:20%"   >平台</td>
	<td valign='middle' style="padding:1  1 1 1;width:80%"   >
		<select name='platform'>
		<option value = "">All</option>
		<?php foreach($platform_list as $key=>$platform_name){?>
			<option value="<?php echo $key;?>"><?php echo $platform_name;?></option>
		<?php }?>
		</select>
	</td>
	</tr>
	<tr>
	  <td valign='middle' align="right"  style="padding:1  1 1 1;width:20%"   >用户UID</td><td  valign='middle' align="left"  >
		<input type='text' name="uid" style="padding:1  1 1 1;width:80%"  value='<?php echo isset($get['uid'])?$get['uid']:''?>' />
	  </td>
	</tr>
	<tr>
	  <td valign='middle' align="right"  style="padding:1  1 1 1;width:20%"   >昵称</td><td  valign='middle' align="left"  >
		<input type='text' name="nickname" style="padding:1  1 1 1;width:80%"  value='<?php echo isset($get['nickname'])?$get['nickname']:''?>' />
	  </td>
	</tr>
	<tr>
	  <td valign='middle' align="right"  style="padding:1  1 1 1;width:20%"   >手机号码</td><td  valign='middle' align="left"  >
		<input type='text' name="phone_num" style="padding:1  1 1 1;width:80%"  value='<?php echo isset($get['phone_num'])?$get['phone_num']:''?>' />
	  </td>
	</tr>
 </table>
  <input  type="submit" value="提交"   style="display:none" />
</div>

<div class="container-fluid">
    <div class="widget-box">
		<div class="widget-title">
			<span class="icon">
				<i class="icon-th"></i>
			</span>
		<h5>用户列表</h5>
		<span style="height:38px;line-height:38px;">
			<input class="btn btn-success btn-mini" type="button" style="cursor:pointer" id='searchBtn'  value="搜索条件">
		</span>
		</div>
		<div class="widget-content nopadding">
			<table   style="width:100%" class='table table-bordered table-striped'>
				<thead>
				<tr class="strong">
					<th><a href="<?php echo $url;?>&field=uid&order=<?php echo ('desc'==$order)?'asc':'desc';?>" style="text-decoration: underline;">UID<?php if($field == 'uid'){?><span style="vertical-align:text-bottom"> <img src='<?php echo img_url("/admin/s_".$order.".png")?>'/></span><?php }?></a></th>
					<th><a href="<?php echo $url;?>&field=nickname&order=<?php echo ('desc'==$order)?'asc':'desc';?>" style="text-decoration: underline;">昵称<?php if($field == 'nickname'){?><span style="vertical-align:text-bottom"> <img src='<?php echo img_url("/admin/s_".$order.".png")?>'/></span><?php }?></a></th>
					<th><a href="<?php echo $url;?>&field=cny&order=<?php echo ('desc'==$order)?'asc':'desc';?>" style="text-decoration: underline;">CNY账户<?php if($field == 'cny'){?><span style="vertical-align:text-bottom"> <img src='<?php echo img_url("/admin/s_".$order.".png")?>'/></span><?php }?></a></th>
					<th>平台</th>
					<th>区码</th>
					<th>电话号码</th>
					<th><a href="<?php echo $url;?>&field=create_time&order=<?php echo ('desc'==$order)?'asc':'desc';?>" style="text-decoration: underline;">注册时间<?php if($field == 'create_time'){?><span style="vertical-align:text-bottom"> <img src='<?php echo img_url("/admin/s_".$order.".png")?>'/></span><?php }?></a></th>
					<th><a href="<?php echo $url;?>&field=create_ip&order=<?php echo ('desc'==$order)?'asc':'desc';?>" style="text-decoration: underline;">注册IP<?php if($field == 'create_ip'){?><span style="vertical-align:text-bottom"> <img src='<?php echo img_url("/admin/s_".$order.".png")?>'/></span><?php }?></a></th>
					<th>状态</th>
					<th >操作</th>
				</tr>
				</thead>
				<tbody>
				<?php if(!empty($page_data)) foreach($page_data as $items){?>
				<tr>
					<td><a href="/user/detail?sid=<?php echo $sid?>&uid=<?php echo $items['uid']?>" style="text-decoration:underline"><?php echo $items['uid'];?></a></td>
					<td><?php echo $items['nickname'];?></td>
					<td>￥<?php echo bcadd($items['cny'],0,2);?></td>
					<td><?php echo $platform_list[$items['platform']];?></td>
					<td><?php echo $items['area'];?></td>
					<td><?php echo $items['phone'];?></td>
					<td><?php echo $items['create_time'];?></td>
					<td><?php echo $items['create_ip'];?></td>
					<td><?php if(strstr($items['phone'],'[delete]')){echo "<font color=red>已删除</font>";}else{echo $items['block']==1?"冻结":"正常";}?></td>
					<td style="padding: 3px">
					<div class="btn-group" ><button class="btn" onclick="getDetail('<?php echo $items['uid']?>')">详细信息</button>
						<button class="btn dropdown-toggle" data-toggle="dropdown" >
							<span class="caret"></span>
						</button>
						<ul class="dropdown-menu">
							<li>
							<?php if(false){?>
							<a onclick="return confirm('确定要删除吗?');" href="/user/deluser?uid=<?php echo $items['uid']?>&sid=<?php echo $sid?>"  >删除用户</a>
							<?php }?>
							<a  href="/user/loginLog?uid=<?php echo $items['uid']?>&sid=<?php echo $sid?>" target="_blank"  >登录信息</a>
							</li>
						</ul>
					</div>
					</td>
				</tr>            		
				<?php }?>
				</tbody>
			</table>
		</div>
		<div id="page" style="width:50%" class="dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_full_numbers">
		   <?php echo $page_html;?>
		</div>
  </div>
  </div>